﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;

namespace DeepThought
{
	public class Fixme
	{
		public static char[] rotn(char[] message, int n)
		{
            char[] decale = new char[message.Length];

            for (int i = 0; i < decale.Length; i++)
            {
                if (message[i] >= 'A' && message[i] <= 'Z')
                    decale[i] = (char)('A' + ((message[i] - 'A' + n) % 26));
                else if (message[i] >= 'a' && message[i] <= 'z')
                    decale[i] = (char)('a' + ((message[i] - 'a' + n) % 26));
                else
                    decale[i] = message[i];
            }

            return decale;
		}

		public static void decrypt(string filename)
		{
            StreamReader file = new StreamReader(filename);
            string s = file.ReadToEnd();
            char[] array = s.ToCharArray();

            file.Close();

            array = rotn(array, 18);

            StreamWriter sw = new StreamWriter("NicoNicoRocks.cs");

            sw.Write(array);

            sw.Close();
		}

		/* Uncomment once you have decrypted the DeepThought class
		public static DeepThought deserialize(string filename)
		{
			throw new NotImplementedException(); // FIXME : some code has been deleted here...
		}
		*/

		public static char[] brute_hash(char[] hash_ref)
		{
			throw new NotImplementedException(); // FIXME : some code has been deleted here...
		}


		public static char[] decode_vingenere(char[] message, char[] key)
		{
			throw new NotImplementedException(); // FIXME : some code has been deleted here...
		}

	}
}
